package org.example.test;

import java.io.File;
import java.io.IOException;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) throws IOException, InterruptedException {
        File file=new File("E:\\测试文件\\some-file.txt");
        File dest=new File("E:\\测试文件\\dest.txt");
        System.out.println(file.exists());
        file.createNewFile();//some-file.txt存在
        System.out.println(dest.exists());//dest.txt不存在
        System.out.println(file.renameTo(dest));
        System.out.println(file.exists());
        System.out.println(dest.exists());
    }
}
